from django.core.mail import send_mail
from djapp import settings


def send_email_view(mail,data):
    subject = '测试邮件主题'
    message = data
    from_email = settings.EMAIL_HOST_USER  # 可以是 settings.py 中的 EMAIL_FROM
    to_email = [mail]  # 收件人邮箱地址列表

    # 发送邮件
    send_status = send_mail(subject, message, from_email, to_email, fail_silently=False)
    print(send_status)
    return send_status


